<template>
	<view>
		<nav-custom bgColor="bg-gradual-pink" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">订单详情</block>
		</nav-custom>
		<view class="content">
			<view class="row">
				<view class="nominal">
					姓名
				</view>
				<view class="input">
					{{carOrder.contact}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					联系电话
				</view>
				<view class="input">
					{{carOrder.telphone}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					用车日期
				</view>
				<view class="input">
					{{carOrder.colectionDate}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					用车时间
				</view>
				<view class="input">
					{{carOrder.collectionTime}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					用车地点
				</view>
				<view class="input">
					{{carOrder.collectionAddress}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					留言
				</view>
				<view class="input">
					{{carOrder.message}}
				</view>
			</view>
		</view>
		<!-- 购买商品列表 -->
		<view class="buy-list">
			<view class="row" v-for="(row,index) in buylist" :key="index">
				<view class="goods-info" v-if="row.targetId == 1">
					<view class="img">
						<image :src="row.image"></image>
					</view>
					<view class="info">
						<view class="title">{{row.normalBrandName}} {{row.normalModelName}} / {{row.normalOrderSum}}辆</view>
						<!-- <view class="spec"></view> -->
						<view class="price-number">
							<view class="price">￥{{row.sumPrice}}</view>
							<view class="number">

							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 明细 -->
		<view class="detail">
			<view class="row">
				<view class="nominal">
					结亲价
				</view>
				<view class="price">
					￥{{carOrder.sumPrice}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					定金
				</view>
				<view class="price">
					￥{{carOrder.depositPrice}}
				</view>
			</view>
			<view class="row">
				<view class="nominal">
					余款
				</view>
				<view class="price">
					￥{{carOrder.tailPrice}}
				</view>
			</view>
		</view>
		<u-loading :visible="loading"></u-loading>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading: true,
				carOrder: null,
				buylist: [], //订单列表
			};
		},
		onLoad(option) {
			this.$api.OrderInfo(option.id).then(res => {
				this.carOrder = res.data.carOrder;
				this.buylist = res.data.carOrderDetailList;
				setTimeout(() => {
					this.loading = false;
				}, 500)
			});
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.content {
		width: calc(100% - 60upx);
		margin: 30upx auto 20upx auto;
		box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
		border-radius: 20upx;
		background-color: #fff;
		display: flex;
		flex-wrap: wrap;

		view {
			display: flex;
		}

		.row {
			width: 94%;
			padding: 0 20upx;
			margin: 0 3%;
			border-top: solid 1upx #eee;

			&:first-child {
				border-top: none;
			}

			.nominal {
				width: 30%;
				height: 100upx;
				font-weight: 200;
				font-size: 30upx;
				align-items: center;
			}

			.input {
				width: 70%;
				padding: 20upx 0;
				align-items: center;
				font-size: 30upx;

				&.switch {
					justify-content: flex-end;
				}

				.textarea {
					margin: 20upx 0;
					min-height: 120upx;
				}
			}

			.del {
				width: 100%;
				height: 100upx;
				justify-content: center;
				align-items: center;
				font-size: 36upx;
				color: #f06c7a;
				background-color: rgba(255, 0, 0, 0.05);
				border-bottom: solid 1upx #eee;
			}
		}
	}

	.buy-list {
		width: calc(100% - 60upx);
		padding: 10upx 3%;
		margin: 30upx auto 20upx auto;
		box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
		border-radius: 20upx;

		.row {
			margin: 30upx 0;

			.goods-info {
				width: 100%;
				display: flex;

				.img {
					width: 22vw;
					height: 22vw;
					border-radius: 10upx;
					overflow: hidden;
					flex-shrink: 0;
					margin-right: 10upx;

					image {
						width: 22vw;
						height: 22vw;
					}
				}

				.info {
					width: 100%;
					height: 22vw;
					overflow: hidden;
					display: flex;
					flex-wrap: wrap;
					position: relative;

					.title {
						width: 100%;
						font-size: 28upx;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 2;
						// text-align: justify;
						overflow: hidden;
					}

					.spec {
						font-size: 22upx;
						background-color: #f3f3f3;
						color: #a7a7a7;
						height: 40upx;
						display: flex;
						align-items: center;
						padding: 0 10upx;
						border-radius: 20upx;
						margin-bottom: 20vw;
					}

					.price-number {
						position: absolute;
						width: 100%;
						bottom: 0upx;
						display: flex;
						justify-content: space-between;
						align-items: flex-end;
						font-size: 28upx;
						height: 40upx;

						.price {
							color: #f06c7a;
						}

						.number {
							display: flex;
							justify-content: center;
							align-items: center;

						}
					}
				}
			}
		}
	}

	.order {
		width: calc(100% - 60upx);
		padding: 10upx 3%;
		margin: 30upx auto 20upx auto;
		box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
		border-radius: 20upx;

		.row {
			margin: 20upx 0;
			height: 40upx;
			display: flex;

			.left {
				font-size: 28upx;
			}

			.right {
				margin-left: 40upx;
				font-size: 26upx;
				color: #999;

				input {
					font-size: 26upx;
					color: #999;
				}
			}
		}
	}

	.blck {
		width: 100%;
		height: 100upx;
	}

	.footer {
		width: 100%;
		padding: 0 4%;
		background-color: #fbfbfb;
		height: 100upx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		font-size: 28upx;
		position: fixed;
		bottom: 0upx;
		z-index: 5;
		border-top: 1upx solid #e7e7e7;

		.settlement {
			width: 80%;
			display: flex;
			justify-content: flex-end;
			align-items: center;

			.sum {
				width: 50%;
				font-size: 28upx;
				margin-right: 10upx;
				display: flex;
				justify-content: flex-end;

				.money {
					font-weight: 600;
				}
			}

			.btn {
				padding: 0 30upx;
				height: 60upx;
				background-color: #f06c7a;
				color: #fff;
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 30upx;
				border-radius: 40upx;
			}
		}
	}

	.detail {
		width: calc(100% - 60upx);
		padding: 10upx 3%;
		margin: 30upx auto 20upx auto;
		box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.1);
		border-radius: 20upx;

		.row {
			height: 60upx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.nominal {
				font-size: 28upx;
			}

			.price {
				font-size: 26upx;
				color: #f06c7a;
			}
		}
	}
</style>
